package com.nbcio.modules.estar.zz.service.impl;

import com.nbcio.modules.estar.zz.entity.ZzImGroup;
import com.nbcio.modules.estar.zz.mapper.ZzImGroupMapper;
import com.nbcio.modules.estar.zz.service.IZzImGroupService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 群聊表
 * @Author: nbacheng
 * @Date:   2024-11-27
 * @Version: V1.0
 */
@Service
public class ZzImGroupServiceImpl extends ServiceImpl<ZzImGroupMapper, ZzImGroup> implements IZzImGroupService {

	@Autowired
	private ZzImGroupMapper zzImGroupMapper;
	
	@Override
	@Transactional
	public void saveMain(ZzImGroup zzImGroup) {
		zzImGroupMapper.insert(zzImGroup);
	}

	@Override
	@Transactional
	public void updateMain(ZzImGroup zzImGroup) {
		zzImGroupMapper.updateById(zzImGroup);
		
		//1.先删除子表数据
		
		//2.子表数据重新插入
	}

	@Override
	@Transactional
	public void delMain(String id) {
		zzImGroupMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			zzImGroupMapper.deleteById(id);
		}
	}
	
}
